﻿import QtQuick
import QtQuick.Controls

Text {
    id: control

    property int iconSource
    property int iconSize                       : 20
    property color iconColor                    : {
        if (!enabled) {
            return Qt.rgba(161/255, 161/255, 161/255, 1)
        }
        return Qt.rgba(0, 0, 0, 1)
    }
    font.family                                 : font_loader.name
    font.pixelSize                              : iconSize
    horizontalAlignment                         : Text.AlignHCenter
    verticalAlignment                           : Text.AlignVCenter
    color                                       : iconColor
    text                                        : (String.fromCharCode(iconSource).toString(16))
    opacity                                     : iconSource > 0

    FontLoader {
        id: font_loader
        source: "qrc:/res/font/FluentIcons.ttf"
    }
}
